<template>
<div style="display: flex;">
  <div style="box-shadow: 2px 0 6px rgb(0 21 41); width: auto">
    <el-menu
        style="min-height: calc( 100vh - 50px );height: 100%"
        background-color="rgb(48,65,86)"
        text-color="#fff"
        :default-active="path"
        :collapse="isCollapse"
        router
        collapse-transition
    >
      <el-sub-menu index="1">
        <template #title>
          <el-icon><Menu /></el-icon>
          <span>系统管理</span>
        </template>
        <el-menu-item index="/home" ><i><el-icon><Setting /></el-icon></i>首页</el-menu-item>
        <el-menu-item index="/policy" ><i><el-icon><User /></el-icon></i>政策信息</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="2">
        <template #title>
          <el-icon><UserFilled /></el-icon>
          <span>用户管理</span>
        </template>
        <el-menu-item index="/user" ><i><el-icon><User /></el-icon></i>用户信息</el-menu-item>

      </el-sub-menu>
      <el-sub-menu index="3">
        <template #title>
          <el-icon><User /></el-icon>
          <span>题库管理</span>
        </template>
        <el-menu-item index="/qbank" ><i><el-icon><User /></el-icon></i>题库管理</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="4">
        <template #title>
          <el-icon><Notebook /></el-icon>
          <span>商品管理</span>
        </template>
        <el-menu-item index="/goods" ><i><el-icon><User /></el-icon></i>商品信息</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="5">
        <template #title>
          <el-icon><List /></el-icon>
          <span>订单管理</span>
        </template>
        <el-menu-item index="/order"><i><el-icon><Tickets /></el-icon></i>订单信息</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="6">
        <template #title>
          <el-icon><ChatLineSquare /></el-icon>
          <span>反馈管理</span>
        </template>
        <el-menu-item index="/messages" ><i><el-icon><User /></el-icon></i>反馈信息</el-menu-item>
      </el-sub-menu>
      <div style="text-align: right;color: white;">
        <el-icon size="20px"  v-show="isCollapse" @click="collapse"><DArrowRight/></el-icon>
        <el-icon size="20px" v-show="!isCollapse" @click="collapse"><DArrowLeft /></el-icon>
      </div>
    </el-menu>
<!--  </el-aside>-->

</div>
</div>
</template>

<script>
import {Tickets, ChatLineRound,CirclePlus,List,Notebook,Location,Menu,DArrowLeft,DArrowRight,Setting,UserFilled,User,ChatLineSquare,Message } from '@element-plus/icons-vue';

export default {
  name: "Aside",
  components:{Location,Notebook,
    Menu,Tickets,
    DArrowLeft,
    DArrowRight,
    Setting,
    UserFilled,
    User,
    ChatLineSquare,
    Message,List,
    ChatLineRound},
  setup(){
    return{
      DArrowLeft,CirclePlus
    }
  },
  data(){
    return{
      isCollapse:false,
      path:"",
      sideWidth:200
    }
 },
  created() {

  },
  methods:{
    collapse(){
      this.isCollapse=!this.isCollapse;
      if(this.isCollapse){
        this.sideWidth=60
      }else{
        this.sideWidth=200
      }
    }
  }
}
</script>

<style scoped>

</style>